﻿using Glue.Converters;
using Xunit;

namespace GlueTests.BaseConverterTests
{
    public class When_FromObject_is_null
    {
        private readonly IConverter converter;
        private readonly TestConverterBetweenStringAndInt testObject;

        public When_FromObject_is_null()
        {
            testObject = new TestConverterBetweenStringAndInt();
            converter = testObject;
        }
        [Fact]
        public void Should_return_default_value()
        {
            Assert.Equal(default(int),converter.Map(null, 1));
        }

        [Fact]
        public void Should_call_inheritor()
        {
            converter.Map(null, 1);
            Assert.True(testObject.MapTowardsRightHasBeenCalled());
        }
    }


}
